package com.future.allUtils.enums;

import lombok.AllArgsConstructor;



@AllArgsConstructor
public enum TargetTypeEnum {

    ARTICLE("文章", 1),
    PSYCHOLOGICAL_KNOWLEDGE("心理知识", 2),
    MEDIA_RESOURCE("媒体资源", 3),
    COMMENT("评论",4);



    private final String targetTypeName;
    private final Integer   targetTypeId;

    public String getTargetTypeName() {
        return targetTypeName;
    }

    public Integer getTargetTypeId() {
        return targetTypeId;
    }

    public static TargetTypeEnum getTargetTypeByName(String targetTypeName){
        for(TargetTypeEnum value:values()){
            if(value.targetTypeName.equals(targetTypeName)){
                return value;
            }
        }
        return null;
    }
    public static TargetTypeEnum getTargetTypeById(Integer targetTypeId){
        for(TargetTypeEnum value:values()){
            if(value.targetTypeId.equals(targetTypeId)){
                return value;
            }
        }
        return null;
    }
}
